<link href="../static/ueditor/themes/default/css/ueditor.min.css" type="text/css" rel="stylesheet">
<link href="../static/ueditor/themes/iframe.css" type="text/css" rel="stylesheet">
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
   <div class="layui-form-item">
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="title" value="{{ d.params.title || '' }}" lay-verify="required" placeholder="标题" autocomplete="off" class="layui-input">
      </script>
    </div>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="checkbox" lay-verify="required" lay-filter="status" name="status" lay-skin="switch" lay-text="显示|隐藏" {{ d.params.status === 1 ? 'checked' : '' }} >
    </script>
    </div>
  </div>
   <div class="layui-form-item">
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="head_url" value="{{ d.params.head_url || '' }}" lay-verify="required" placeholder="路径地址" autocomplete="off" class="layui-input">
      </script>
    </div>
    <div class="layui-input-inline" style="width: 350px;">
      <script type="text/html" template>
        <input type="text" name="keywords" value="{{ d.params.keywords || '' }}" lay-verify="required" placeholder="关键词" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
   <div class="layui-form-item">
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="icon" value="{{ d.params.icon || '' }}" lay-verify="required" placeholder="分类图标" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-inline" style="width: 345px;">
      <script type="text/html" template>
        <input type="text" name="thumb" id="thumb" value="{{ d.params.thumb || '' }}"  placeholder="请上传图片" autocomplete="off" class="layui-input" >
      </script>
    </div>
    <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-thumb">上传图片</button>
    <div></div>
    <!--<div class="layui-input-inline" style="width: 150px;">-->
    <!--  <script type="text/html" template>-->
    <!--    <input type="text" name="sort" value="{{ d.params.sort || '' }}" placeholder="排序" autocomplete="off" class="layui-input">-->
    <!--  </script>-->
    <!--</div>-->
  </div>
  <div class="layui-form-item">
    <div class="layui-input-inline">
      <script type="text/html" template>
        <textarea name="description" lay-verify="required" style="width: 600px; height: 120px;" placeholder="描述" autocomplete="off" class="layui-textarea">{{ d.params.description || '' }}</textarea>
      </script>
    </div>
  </div>
  <script type="text/html" template>
    {{#
      if(d.params.thumb!=''&&d.params.thumb!=undefined){
    }}
      <div class="layui-form-item">
        <div class="layui-input-inline" style="width: 345px;">
          <img src="{{ d.params.thumb }}" height="260">
        </div>
      </div>
    {{#
      }
    }}
  </script>
  <div class="layui-form-item">
    <div class="layui-input-inline" style="margin-bottom: 20px; width: 80%;">
      <script id="editor" type="text/plain"></script>
    </div>
  </div>
  <!-- <div class="layui-form-item">
    <label class="layui-form-label">时间</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="create_time" value="{{ d.params.create_time || '' }}" lay-verify="required" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input"  id="test5" onclick="createTime()">
      </script>
    </div>
  </div> -->

  <!-- <div class="layui-form-item">
    <label class="layui-form-label">发布人</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        
      </script>
    </div>
  </div> -->

  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || '' }}">
  </script>

  <script type="text/html" template>
    <input type="hidden" name="lang" value="{{ layui.data('lang').lang }}">
  </script>

  <script type="text/html" template>
    <input type="hidden" name="varname" value="{{ d.params.varname || '' }}">
  </script>

  <div class="layui-form-item">
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>
<script type="text/javascript" src="https://s1.pstatp.com/cdn/expire-1-M/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="../static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="../static/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="../static/ueditor/index.js"></script>
<script type="text/javascript" charset="utf-8" src="../static/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
  layui.use(['admin', 'form', 'upload', 'layedit', 'laydate'], function () {
    var $ = layui.$
      , admin = layui.admin
      , form = layui.form
      , layedit = layui.layedit
      , upload = layui.upload;
    var laydate = layui.laydate;

    upload.render({
      elem: '#layuiadmin-upload-thumb'
      , url: '/api/uploads/photos/column/singlepage'
      , accept: 'file'
      , method: 'get'
      // ,acceptMime: 'image/*'
      , done: function (res) {
        $(this.item).prev("div").children("input").val(res.data.src)
        // console.log(res)
      }
    });

    form.on('radio(status)', function (data) {
      // console.log(data.elem); //得到radio原始DOM对象
      console.log(data.value); //被点击的radio的value值
    });

  })
  function createTime() {
    var laydate = layui.laydate;

    laydate.render({
      elem: '#test5'
      , type: 'datetime'
      , show: true
    });
  }
</script>